import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import mainRouter from '@/views/main/routes'
Vue.use(VueRouter)
// 登录注册路由注册
import loginRouter from '@/views/register/routes'
import mineRouter from '@/views/mines/routes'
import movieRouter from '@/views/movies/routes'
import cinemaRouter from '@/views/cinemas/routes'
const routes = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home,
    
  // },
  {
    path:'',
    redirect:"/guide"
  },
  {
    path:'/guide',
    name:'Guide',
    component:() => import("../views/guide/guide")
  },
  {
    path:'/app',
    name:'app',
    // redirect:"/app/movie",
    component:() => import("../views/main/main"),
    children:[
      ...mainRouter
    ]
  },
  ...loginRouter,
  ...mineRouter,
  ...movieRouter,
  ...cinemaRouter,
  {
    path:'*',
    redirect:{
      name:'app',
    }
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: "",
  routes,
  history
})

export default router
